﻿package com.bizmlib.utils
{
	public function mixRGBColorComponents(colorAComponents:Object, colorBComponents:Object, proportion:Number):Object
	{
		proportion = Math.max(0, Math.min(1, proportion));
		
		var resultingComponents:Object = new Object();
		resultingComponents.red = colorAComponents.red + (colorBComponents.red - colorAComponents.red)*proportion;
		resultingComponents.green = colorAComponents.green + (colorBComponents.green - colorAComponents.green)*proportion;
		resultingComponents.blue = colorAComponents.blue + (colorBComponents.blue - colorAComponents.blue)*proportion;
		return resultingComponents;
	}
}